<template>
<div class="wrapper">
  <swiper>
    <swiper-item v-for="(item,index) in swiper" :key="index">
      <img :src="item" alt="" @load="imageLoad" />
    </swiper-item>
  </swiper>

</div>
  
</template>

<script>
import {Swiper, SwiperItem} from "components/common/swiper";
export default {
  name: 'HomeSwiper',
  data () {
    return {
      isLoad:false,
      swiper:[
        "https://zpc666.oss-cn-hangzhou.aliyuncs.com/2020/12/21/b65578d5bd934a69a0d05c9719843f15banner@3x.png",
        "https://zpc666.oss-cn-hangzhou.aliyuncs.com/2020/12/21/b65578d5bd934a69a0d05c9719843f15banner@3x.png",
        "https://zpc666.oss-cn-hangzhou.aliyuncs.com/2020/12/21/b65578d5bd934a69a0d05c9719843f15banner@3x.png"
        ]
    }
  },
  components: {
    Swiper,
    SwiperItem
    },
    methods: {
      /* 只执行一次 */
      imageLoad () {
        if(!this.isLoad){
          this.$emit('swiperImageLoad')
          this.isLoad = true
        }
        
      }
    }
}
</script>

<style lang="less" scoped>
.wrapper /deep/ .swiper-pagination-bullet-active {
  background: red;
}
.wrapper /deep/ .swiper-pagination-bullets span {
  float: right;
}
.wrapper /deep/ .swiper-pagination-bullets span {
  float: right;
  &:first-child {
    margin-right: 0.24rem;
  }
}
.wrapper {
    overflow: hidden;
    width: 3.75rem;
    background: #eee;
    .swiper-img {
      width: 100%;
    }
  }
</style>
